import { _decorator, Component, Node, Sprite } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('ZumaSingleMajiang')
export class ZumaSingleMajiang extends Component {

    //麻将
    @property(Sprite)
    public MajiangSprite: Sprite = null;

    //麻将状态
    @property(Sprite)
    private Statue: Sprite = null;

    //麻将名称
    public MajiangName: string = "";


    /**
     * 更新麻将
     */
    public UpdateMajiang(_name: string, _statue: number, _islock: boolean) {
        this.MajiangName = _name;
        this.MajiangSprite.spriteFrame = app.resManager.SpriteFrames[_name];
        this.MajiangSprite.node.active = !_islock;
    }

    /**
     * 解锁
     */
    public Unlock() {
        this.MajiangSprite.node.active = true;
    }

    /**
     * 返回是否锁
     */
    public ReturnIsLock(): boolean {
        return !this.MajiangSprite.node.active;
    }
}


